/**
 * <copyright>
 * </copyright>
 *
 * $Id: EusecasePackageImpl.java 483 2007-04-03 03:07:06Z petterei $
 */
package biz.modelx.precise.usecase.ui.model.eusecase.impl;

import biz.modelx.precise.ui.model.eprecise.EprecisePackage;

import biz.modelx.precise.usecase.ui.model.eusecase.Actor;
import biz.modelx.precise.usecase.ui.model.eusecase.EusecaseFactory;
import biz.modelx.precise.usecase.ui.model.eusecase.EusecasePackage;
import biz.modelx.precise.usecase.ui.model.eusecase.SystemBoundery;
import biz.modelx.precise.usecase.ui.model.eusecase.Usecase;
import biz.modelx.precise.usecase.ui.model.eusecase.UsecaseModel;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class EusecasePackageImpl extends EPackageImpl implements EusecasePackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass usecaseModelEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass actorEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass usecaseEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass systemBounderyEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see biz.modelx.precise.usecase.ui.model.eusecase.EusecasePackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private EusecasePackageImpl() {
		super(eNS_URI, EusecaseFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this
	 * model, and for any others upon which it depends.  Simple
	 * dependencies are satisfied by calling this method on all
	 * dependent packages before doing anything else.  This method drives
	 * initialization for interdependent packages directly, in parallel
	 * with this package, itself.
	 * <p>Of this package and its interdependencies, all packages which
	 * have not yet been registered by their URI values are first created
	 * and registered.  The packages are then initialized in two steps:
	 * meta-model objects for all of the packages are created before any
	 * are initialized, since one package's meta-model objects may refer to
	 * those of another.
	 * <p>Invocation of this method will not affect any packages that have
	 * already been initialized.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static EusecasePackage init() {
		if (isInited) return (EusecasePackage)EPackage.Registry.INSTANCE.getEPackage(EusecasePackage.eNS_URI);

		// Obtain or create and register package
		EusecasePackageImpl theEusecasePackage = (EusecasePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EusecasePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EusecasePackageImpl());

		isInited = true;

		// Initialize simple dependencies
		EprecisePackage.eINSTANCE.eClass();

		// Create package meta-data objects
		theEusecasePackage.createPackageContents();

		// Initialize created meta-data
		theEusecasePackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theEusecasePackage.freeze();

		return theEusecasePackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getUsecaseModel() {
		return usecaseModelEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecaseModel_Susecases() {
		return (EReference)usecaseModelEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecaseModel_Sactors() {
		return (EReference)usecaseModelEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecaseModel_Boundaries() {
		return (EReference)usecaseModelEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getActor() {
		return actorEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getActor_Usecases() {
		return (EReference)actorEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getUsecase() {
		return usecaseEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecase_Include() {
		return (EReference)usecaseEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecase_Extend() {
		return (EReference)usecaseEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecase_Generalization() {
		return (EReference)usecaseEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getUsecase_Actors() {
		return (EReference)usecaseEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getSystemBoundery() {
		return systemBounderyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getSystemBoundery_Sbusecases() {
		return (EReference)systemBounderyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EusecaseFactory getEusecaseFactory() {
		return (EusecaseFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		usecaseModelEClass = createEClass(USECASE_MODEL);
		createEReference(usecaseModelEClass, USECASE_MODEL__SUSECASES);
		createEReference(usecaseModelEClass, USECASE_MODEL__SACTORS);
		createEReference(usecaseModelEClass, USECASE_MODEL__BOUNDARIES);

		actorEClass = createEClass(ACTOR);
		createEReference(actorEClass, ACTOR__USECASES);

		usecaseEClass = createEClass(USECASE);
		createEReference(usecaseEClass, USECASE__INCLUDE);
		createEReference(usecaseEClass, USECASE__EXTEND);
		createEReference(usecaseEClass, USECASE__GENERALIZATION);
		createEReference(usecaseEClass, USECASE__ACTORS);

		systemBounderyEClass = createEClass(SYSTEM_BOUNDERY);
		createEReference(systemBounderyEClass, SYSTEM_BOUNDERY__SBUSECASES);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		EprecisePackage theEprecisePackage = (EprecisePackage)EPackage.Registry.INSTANCE.getEPackage(EprecisePackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		usecaseModelEClass.getESuperTypes().add(theEprecisePackage.getPPersistable());
		actorEClass.getESuperTypes().add(theEprecisePackage.getPNameable());
		usecaseEClass.getESuperTypes().add(theEprecisePackage.getPNameable());
		systemBounderyEClass.getESuperTypes().add(theEprecisePackage.getPNameable());

		// Initialize classes and features; add operations and parameters
		initEClass(usecaseModelEClass, UsecaseModel.class, "UsecaseModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getUsecaseModel_Susecases(), this.getUsecase(), null, "susecases", null, 0, -1, UsecaseModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getUsecaseModel_Sactors(), this.getActor(), null, "sactors", null, 0, -1, UsecaseModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		initEReference(getUsecaseModel_Boundaries(), this.getSystemBoundery(), null, "boundaries", null, 0, -1, UsecaseModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(actorEClass, Actor.class, "Actor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getActor_Usecases(), this.getUsecase(), this.getUsecase_Actors(), "usecases", null, 0, -1, Actor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		getActor_Usecases().getEKeys().add(theEprecisePackage.getPPersistable_Identifier());

		initEClass(usecaseEClass, Usecase.class, "Usecase", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getUsecase_Include(), this.getUsecase(), null, "include", null, 0, -1, Usecase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		initEReference(getUsecase_Extend(), this.getUsecase(), null, "extend", null, 0, 1, Usecase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getUsecase_Generalization(), this.getUsecase(), null, "generalization", null, 0, 1, Usecase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		getUsecase_Generalization().getEKeys().add(theEprecisePackage.getPPersistable_Identifier());
		initEReference(getUsecase_Actors(), this.getActor(), this.getActor_Usecases(), "actors", null, 0, -1, Usecase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		getUsecase_Actors().getEKeys().add(theEprecisePackage.getPPersistable_Identifier());

		initEClass(systemBounderyEClass, SystemBoundery.class, "SystemBoundery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getSystemBoundery_Sbusecases(), this.getUsecase(), null, "sbusecases", null, 0, -1, SystemBoundery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //EusecasePackageImpl
